<template>
	<u-checkbox-group v-model="protocols">
		<view class="container">
			<u-checkbox :name='true' shape="circle" active-color="#222" :size="16"></u-checkbox>
			<view class="font-color-black font-size-12">
				<!-- 示例 -->
				<!-- 未注册的手机号将会自动创建账号，登录即代表您同意并接受
				<text class="font-color-textPrimary" @tap.stop="$u.route()">《用户隐私协议》</text>
				和
				<text class="font-color-textPrimary" @tap.stop="$u.route()">《服务协议》</text> -->
				<slot></slot>
			</view>
		</view>
	</u-checkbox-group>
</template>

<script>
	export default {
		name: "w-agreement",
		data() {
			return {
				
			};
		},
		props:{
			protocol:{
				type: Boolean,
				default: false
			}
		},
		model: {
			prop: 'protocol',
			event: 'change'
		},
		computed: {
			//是否同意隐私协议
			protocols: { 
				get() {
					return [this.protocol]
				},
				set(val) {
					this.$emit('change', Boolean(val[0]))
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		width: 100%;
		@extend .flex,.flex-ai-start;
	}
</style>
